package me.aartikov.alligator.navigationfactories;


import me.aartikov.alligator.destinations.Destination;
import me.aartikov.alligator.helpers.MiFraction;
import me.aartikov.alligator.Screen;
import ohos.aafwk.ability.Ability;

/**
 * Associates {@link Screen} with its Ohos implementation.
 */
public interface NavigationFactory {
    /**
     * Returns {@link Destination} for a given screen.
     *
     * @param screenClass screen class
     * @return destination or null if there is no destination associated with this screen
     */

    Destination getDestination(Class<? extends Screen> screenClass);

    /**
     * Retrieves screen class from an activity.
     *
     * @param activity activity
     * @return screen class or null if there is no screen class information in the activity.
     */

    Class<? extends Screen> getScreenClass(Ability activity);

    /**
     * Retrieves screen class from a fragment.
     *
     * @param fragment fragment
     * @return screen class or null if there is no screen class information in the fragment.
     */

    Class<? extends Screen> getScreenClass( MiFraction fragment);

    /**
     * Returns screen class by a request code (for a screen that can return result).
     *
     * @param requestCode request code
     * @return screen class or null if there is no screen associated with this request code
     */

    Class<? extends Screen> getScreenClass(int requestCode);

    /**
     * Returns screen class for an previous activity in a back stack.
     *
     * @param activity current activity that stores information about previous screen class
     * @return screen class for an previous activity
     */

    Class<? extends Screen> getPreviousScreenClass( /*Activity*/ Ability activity);
}